Skip to main content

Dynamic Weights

InterSwap introduces a new mechanism for dynamically adjusting token weights during single-asset liquidity provision and removal. Adding liquidity proportionally increases the asset’s weight, while removing liquidity decreases it.

Liquidity provision and removal do not affect swap quotes. This mechanism prevents the possibility of draining the pool.

Let’s consider an example of an initial pool with equal weights:

AssetReserveWeight Points
BNB200001000
ETH50001000
AVAX450001000

Total Weight: 3000

We are adding 20 ETH liquidity. Let's calculate how many weight points should be added to ETH.

price per point = reserve / points count.

p=a/(r/t)p=a /(r / t)

Where:

  • pp - points to be added or reduced.
  • aa - amount of tokens added or removed.
  • rr - current reserve of token.
  • tt - total points.

In our example:

points = 20 / (5000 / 1000) = 4

AssetReserveWeight Points
BNB200001000
ETH50201004
AVAX450001000

Total Weight: 3004